|
Eclipse Platform Pre-release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The central class of the Eclipse Platform Runtime. This class cannot be instantiated or subclassed by clients; all functionality is provided by static methods. Features include:
The platform is in one of two states, running or not running, at all
times. The only ways to start the platform running, or to shut it down,
are on the bootstrap BootLoader
class. Code in plug-ins will
only observe the platform in the running state. The platform cannot
be shutdown from inside (code in plug-ins have no access to
BootLoader
).
Note: This is an early access API to the new OSGI-based Eclipse 3.0 Platform Runtime. Because the APIs for the new runtime have not yet been fully stabilized, they should only be used by clients needing to take particular advantage of new OSGI-specific functionality, and only then with the understanding that these APIs may well change in incompatible ways until they reach their finished, stable form (post-3.0).
Field Summary | |
static int |
FAILED_DELETE_METADATA
Status code constant (value 6) indicating the platform could not delete some of its metadata. |
static int |
FAILED_READ_METADATA
Status code constant (value 4) indicating the platform could not read some of its metadata. |
static int |
FAILED_WRITE_METADATA
Status code constant (value 5) indicating the platform could not write some of its metadata. |
static int |
INTERNAL_ERROR
Status code constant (value 3) indicating an error internal to the platform has occurred. |
static int |
PARSE_PROBLEM
Status code constant (value 1) indicating a problem in a plug-in manifest ( plugin.xml ) file. |
static String |
PI_RUNTIME
The unique identifier constant (value " org.eclipse.core.runtime ")
of the Core Runtime plug-in. |
static String |
PI_RUNTIME_COMPATIBILITY
|
static int |
PLUGIN_ERROR
Status code constant (value 2) indicating an error occurred while running a plug-in. |
static String |
PREF_PLATFORM_PERFORMANCE
Name of a preference for configuring the performance level for this system. |
static String |
PT_APPLICATIONS
The simple identifier constant (value " applications ") of
the extension point of the Core Runtime plug-in where plug-ins declare
the existence of runnable applications. |
static String |
PT_SHUTDOWN_HOOK
|
static String |
PT_URLHANDLERS
|
Method Summary | |
void |
addAuthorizationInfo(URL serverUrl,
String realm,
String authScheme,
Map info)
Adds the given authorization information to the keyring. |
void |
addLogListener(ILogListener listener)
Adds the given log listener to the notification list of the platform. |
void |
addProtectionSpace(URL resourceUrl,
String realm)
Adds the specified resource to the protection space specified by the given realm. |
URL |
asLocalURL(URL url)
Returns a URL which is the local equivalent of the supplied URL. |
void |
endSplash()
Takes down the splash screen if one was put up. |
URL |
find(org.osgi.framework.Bundle b,
IPath path)
|
URL |
find(org.osgi.framework.Bundle b,
IPath path,
Map override)
|
void |
flushAuthorizationInfo(URL serverUrl,
String realm,
String authScheme)
Removes the authorization information for the specified protection space and given authorization scheme. |
IAdapterManager |
getAdapterManager()
Returns the adapter manager used for extending IAdaptable objects. |
String[] |
getAllArgs()
Returns all command line arguments specified when the running framework was started. |
String[] |
getApplicationArgs()
Returns the arguments not consumed by the framework implementation itself. |
Map |
getAuthorizationInfo(URL serverUrl,
String realm,
String authScheme)
Returns the authorization information for the specified protection space and given authorization scheme. |
IPath |
getConfigurationMetadataLocation()
Returns the location in the filesystem of the configuration information used to run this instance of Eclipse. |
String[] |
getFrameworkArgs()
Returns the arguments consumed by the framework implementation itself. |
URL |
getInstallURL()
Returns URL at which the Platform runtime executables and libraries are installed. |
IJobManager |
getJobManager()
Returns the platform job manager. |
IPath |
getLocation()
Returns the location of the platform working directory. |
ILog |
getLog(org.osgi.framework.Bundle bundle)
Returns the log for the given bundle. |
IPath |
getLogFileLocation()
Returns the location of the platform log file. |
String |
getNL()
Returns the string name of the current locale for use in finding files whose path starts with $nl$ . |
String |
getOS()
Returns the string name of the current operating system for use in finding files whose path starts with $os$ . |
String |
getOSArch()
Returns the string name of the current system architecture. |
String |
getProtectionSpace(URL resourceUrl)
Returns the protection space (realm) for the specified resource, or null if the realm is unknown. |
ResourceBundle |
getResourceBundle(org.osgi.framework.Bundle bundle)
Returns the given bundle's resource bundle for the current locale. |
String |
getResourceString(org.osgi.framework.Bundle bundle,
String value)
Returns a resource string corresponding to the given argument value. |
String |
getResourceString(org.osgi.framework.Bundle bundle,
String value,
ResourceBundle resourceBundle)
Returns a resource string corresponding to the given argument value and bundle. |
IPath |
getStateLocation(org.osgi.framework.Bundle bundle)
Returns the location in the local file system of the plug-in state area for the given bundle. |
String |
getWS()
Returns the string name of the current window system for use in finding files whose path starts with $ws$ . |
InputStream |
openStream(org.osgi.framework.Bundle b,
IPath file)
|
InputStream |
openStream(org.osgi.framework.Bundle b,
IPath file,
boolean localized)
Returns an input stream for the specified file. |
void |
removeLogListener(ILogListener listener)
Removes the indicated (identical) log listener from the notification list of the platform. |
URL |
resolve(URL url)
Returns a URL which is the resolved equivalent of the supplied URL. |
void |
run(ISafeRunnable code)
Runs the given runnable in a protected mode. |
Field Detail |
public static final String PREF_PLATFORM_PERFORMANCE
This value can be used by all components to customize features to suit the speed of the user's machine. The platform job manager uses this value to make scheduling decisions about background jobs.
The preference value must be an integer between the constant values MIN_PERFORMANCE and MAX_PERFORMANCE
#MIN_PERFORMANCE
,
#MAX_PERFORMANCE
,
Constant Field Valuespublic static final String PI_RUNTIME
org.eclipse.core.runtime
")
of the Core Runtime plug-in.
public static final String PI_RUNTIME_COMPATIBILITY
public static final String PT_APPLICATIONS
applications
") of
the extension point of the Core Runtime plug-in where plug-ins declare
the existence of runnable applications. A plug-in may define any
number of applications; however, the platform is only capable
of running one application at a time.
org.eclipse.core.boot.BootLoader#run
,
Constant Field Valuespublic static final String PT_URLHANDLERS
public static final String PT_SHUTDOWN_HOOK
public static final int PARSE_PROBLEM
plugin.xml
) file.
public static final int PLUGIN_ERROR
public static final int INTERNAL_ERROR
public static final int FAILED_READ_METADATA
public static final int FAILED_WRITE_METADATA
public static final int FAILED_DELETE_METADATA
Method Detail |
public void addAuthorizationInfo(URL serverUrl, String realm, String authScheme, Map info) throws CoreException
Map
of String
to String
and typically
contains information such as usernames and passwords.
serverUrl
- the URL identifying the server for this authorization
information. For example, "http://www.example.com/".realm
- the subsection of the given server to which this
authorization information applies. For example,
"realm1@example.com" or "" for no realm.authScheme
- the scheme for which this authorization information
applies. For example, "Basic" or "" for no authorization schemeinfo
- a Map
containing authorization information
such as usernames and passwords (key type : String
,
value type : String
)
CoreException
- if there are problems setting the
authorization information. Reasons include:
public void addLogListener(ILogListener listener)
Once registered, a listener starts receiving notification as entries
are added to plug-in logs via ILog.log()
. The listener continues to
receive notifications until it is replaced or removed.
listener
- the listener to registerILog.addLogListener(org.eclipse.core.runtime.ILogListener)
,
removeLogListener(org.eclipse.core.runtime.ILogListener)
public void addProtectionSpace(URL resourceUrl, String realm) throws CoreException
resourceUrl
- the URL identifying the resources to be added to
the specified protection space. For example,
"http://www.example.com/folder/".realm
- the name of the protection space. For example,
"realm1@example.com"
CoreException
- if there are problems setting the
authorization information. Reasons include:
public URL asLocalURL(URL url) throws IOException
url
- original plug-in-relative URL.
IOException
- if unable to resolve URLresolve(java.net.URL)
,
IPluginDescriptor.getInstallURL()
public void flushAuthorizationInfo(URL serverUrl, String realm, String authScheme) throws CoreException
serverUrl
- the URL identifying the server to remove the
authorization information for. For example,
"http://www.example.com/".realm
- the subsection of the given server to remove the
authorization information for. For example,
"realm1@example.com" or "" for no realm.authScheme
- the scheme for which the authorization information
to remove applies. For example, "Basic" or "" for no
authorization scheme.
CoreException
- if there are problems removing the
authorization information. Reasons include:
public IAdapterManager getAdapterManager()
IAdaptable
objects.
IAdapterManager
public Map getAuthorizationInfo(URL serverUrl, String realm, String authScheme)
null
if no
such information exists.
serverUrl
- the URL identifying the server for the authorization
information. For example, "http://www.example.com/".realm
- the subsection of the given server to which the
authorization information applies. For example,
"realm1@example.com" or "" for no realm.authScheme
- the scheme for which the authorization information
applies. For example, "Basic" or "" for no authorization scheme
null
if no
such information existspublic IPath getLocation()
public IPath getLogFileLocation()
public String getProtectionSpace(URL resourceUrl)
null
if the realm is unknown.
resourceUrl
- the URL of the resource whose protection space is
returned. For example, "http://www.example.com/folder/".
null
if the realm is unknownpublic void removeLogListener(ILogListener listener)
listener
- the listener to deregisterILog.removeLogListener(org.eclipse.core.runtime.ILogListener)
,
addLogListener(org.eclipse.core.runtime.ILogListener)
public URL resolve(URL url) throws IOException
url
- original plug-in-relative URL.
IOException
- if unable to resolve URLasLocalURL(java.net.URL)
,
IPluginDescriptor.getInstallURL()
public void run(ISafeRunnable code)
code
- the runnable to runpublic ILog getLog(org.osgi.framework.Bundle bundle)
public IJobManager getJobManager()
public URL getInstallURL()
public IPath getConfigurationMetadataLocation()
public void endSplash()
public URL find(org.osgi.framework.Bundle b, IPath path)
public URL find(org.osgi.framework.Bundle b, IPath path, Map override)
public InputStream openStream(org.osgi.framework.Bundle b, IPath file) throws IOException
IOException
public InputStream openStream(org.osgi.framework.Bundle b, IPath file, boolean localized) throws IOException
The caller must close the returned stream when done.
file
- path relative to plug-in installation locationlocalized
- true
for the localized version
of the file, and false
for the file exactly
as specified
IOException
public IPath getStateLocation(org.osgi.framework.Bundle bundle)
The plug-in state area is a file directory within the platform's metadata area where a plug-in is free to create files. The content and structure of this area is defined by the plug-in, and the particular plug-in is solely responsible for any files it puts there. It is recommended for plug-in preference settings and other configuration parameters.
bundle
- the bundle whose state location if returned
public ResourceBundle getResourceBundle(org.osgi.framework.Bundle bundle) throws MissingResourceException
The resource bundle is stored as the plugin.properties
file
in the plug-in install directory, and contains any translatable
strings used in the plug-in manifest file (plugin.xml
)
along with other resource strings used by the plug-in implementation.
MissingResourceException
- if the resource bundle was not foundpublic String getResourceString(org.osgi.framework.Bundle bundle, String value)
Equivalent to getResourceString(value, getResourceBundle())
value
- the value
getResourceBundle(org.osgi.framework.Bundle)
public String getResourceString(org.osgi.framework.Bundle bundle, String value, ResourceBundle resourceBundle)
For example, assume resource bundle plugin.properties contains name = Project Name
getResourceString("Hello World") returns "Hello World" getResourceString("%name") returns "Project Name" getResourceString("%name Hello World") returns "Project Name" getResourceString("%abcd Hello World") returns "Hello World" getResourceString("%abcd") returns "%abcd" getResourceString("%%name") returns "%name"
value
- the valuebundle
- the resource bundle
getResourceBundle(org.osgi.framework.Bundle)
public String getOSArch()
java.lang.System.getProperty("os.arch")
.
public String getNL()
$nl$
.
public String getOS()
$os$
. OS_UNKNOWN
is
returned if the operating system cannot be determined.
The value may indicate one of the operating systems known to the platform
(as specified in knownOSValues
) or a user-defined string if
the operating system name is specified on the command line.
#knownOSValues
public String getWS()
$ws$
. null
is returned
if the window system cannot be determined.
null
public String[] getAllArgs()
public String[] getFrameworkArgs()
public String[] getApplicationArgs()
|
Eclipse Platform Pre-release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |